package com.tsingteng.cosfun.ui.message.comment.usercomment;

import com.tsingteng.cosfun.bean.BaseDataBean;
import com.tsingteng.cosfun.bean.ParagraphComment;
import com.tsingteng.cosfun.bean.PlayCommont;
import com.tsingteng.cosfun.bean.PullBlackBean;
import com.tsingteng.cosfun.bean.UserCommentResultBean;
import com.tsingteng.cosfun.common.Config;
import com.tsingteng.cosfun.mvp.module.BaseModel;

import retrofit2.Callback;


/**
 * @我。赞我。评论我页面点击展示段子评论页M层
 * 常胜
 * 2018.8.23
 * */
public class UserCommentModel extends BaseModel implements IUserCommentModel {


    @Override
    public void getPlayCommentListResponse(int workId, int page, String commentIds, Callback<BaseDataBean<PlayCommont>> callback) {
//        if(commentIds == 0){
//            doRxRequest().getUserPageComment(workId+"",page+"", Config.PAGE_SIZE+"").enqueue(callback);
//        }else{
            doRxRequest().getUserPageComment(workId+"",page+"", Config.PAGE_SIZE+"",commentIds).enqueue(callback);
//        }
    }

    @Override
    public void getMyPlayCommentResponse(int id, String contentType, String content, String reply_id, int commentId, Callback<UserCommentResultBean> callback) {
        if("0".equals(contentType)){
            doRxRequest().getUserResultComment(id+"",contentType,content,"").enqueue(callback);
        }else{
            doRxRequest().getUserReplyComment(id+"",contentType,content,commentId+"","1").enqueue(callback);
        }
    }

    @Override
    public void getPraiseOrNot(String praise_type, String id, String type, Callback<PullBlackBean> callback) {
        doRxRequest().getPraiseYN(praise_type,id,type).enqueue(callback);
    }

    @Override
    public void getDeleteCommentResponse(int commentId, Callback<PullBlackBean> callback) {
        doRxRequest().getDeleteComment(commentId+"").enqueue(callback);
    }

    @Override
    public void getAddPlayComment(String paragraph_id, String comment_type, String content, String comment_object_id, Callback<BaseDataBean<ParagraphComment>> callback) {
        doRxRequest().getAddPlayCommentMessage(paragraph_id,comment_type,content,comment_object_id).enqueue(callback);
    }
}
